/// <reference path="../typings/index.d.ts" />
/// <reference path="../src/operationService.ts" />
/// <reference path="../src/tms.ts" />
describe('operationService', () => {
    var injector:ng.auto.IInjectorService;
    var service:IOperationService;

    beforeEach(() => {
        injector = angular.injector(['ng', 'tms']);
        service = injector.get<IOperationService>('operationService');
    });

    /**
     * 获取APP竞价列表
     */
    it("Get quotation",(done) => {
        service.quotation("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe("11");
            done();
        },(err) =>{
            done.fail(err);
        })
    });

    /**
     * 获取订单列表
     */
    it("Get orderList",(done) =>{
        service.getOrderList("1",true,"3","4","5","6","7","8,8,8","9","10","11","12","13","14",0,10).then((res) => {
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8,8,8|9|10|11|12|13|14|0|10");
            expect(res.data.total).toBe(10);
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    /**
     * 承运单test
     */
    it("get carryOrder list normal",(done) => {
        service.getCarryOrderList("",true,"","","","","","","","","","","","","","","","","","","","","",0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||||||||||||||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        })
    });
    it("get carryOrder list allArgument",(done) => {
        service.getCarryOrderList("1",true,"2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22",0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1|true|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|0|10');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    /**
     * 获取订单编号为"11"的订单子单的列表数据
     */
    it("get orderChildList list allArgument",(done) => {
        service.getOrderChildList("11").then((res) => {
            //expect(res.data.total).toBe(10);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    /**
     * 获取承运单编号为“11”的费用申领列表
     */
    it("get feeList list allArgument",(done) => {
        service.getFeeList("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    /**
     * 应收登记列表
     */
    it("get receivable list allArgument",(done) => {
        service.getReceivableList("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    /**
     * 订单详情
     */
    it("get orderDetail",(done) => {
        service.getOrderDetail("11").then((res) =>{
            expect(res.data.id).toBe("0");
            expect(res.data.planOfficer).toBe("1");
            expect(res.data.businessOfficer).toBe("2");
            expect(res.data.customerServiceOfficer).toBe("3");
            expect(res.data.dispatchOfficer).toBe("4");
            expect(res.data.plannerId).toBe(5);
            expect(res.data.placeOrderTime).toBe("6");
            expect(res.data.urgencyDegree).toBe("7");
            expect(res.data.clientName).toBe("8");
            expect(res.data.consignorName).toBe("9");
            expect(res.data.consignorPhone).toBe("10");
            expect(res.data.viaAddressList).toBe("11");
            expect(res.data.orderStatus).toBe(12);
            expect(res.data.quantityOfGoods).toBe("12");
            expect(res.data.orderId).toBe("13");
            expect(res.data.urgency).toBe(14);
            expect(res.data.urgencyUnit).toBe("15");
            expect(res.data.businessOfficerId).toBe("16");
            expect(res.data.customerServiceOfficerId).toBe("17");
            expect(res.data.dispatchOfficerId).toBe("18");
            expect(res.data.clientId).toBe("19");
            expect(res.data.clientCornet).toBe("20");   
            expect(res.data.consignorId).toBe("21");
            expect(res.data.shipPriceContent).toBe("22");
            expect(res.data.carType).toBe("23");
            expect(res.data.carLength).toBe("24");
            expect(res.data.carriageWay).toBe("25");
            expect(res.data.loadingResult).toBe("26");
            expect(res.data.attachment.length).toBe(3);
            expect(res.data.remarks).toBe("28");
            expect(res.data.viaList.length).toBe(2);
            expect(res.data.shipProvince).toBe("30");
            expect(res.data.shipCity).toBe("31");
            expect(res.data.shipArea).toBe("32");
            expect(res.data.shipDetail).toBe("33");
            expect(res.data.shipAddress).toBe("34");
            expect(res.data.deliverProvince).toBe("35");
            expect(res.data.deliverCity).toBe("36");
            expect(res.data.deliverArea).toBe("37");
            expect(res.data.deliverDetail).toBe("38");
            expect(res.data.deliverAddress).toBe("39");
            expect(res.data.shipTime).toBe("40");
            expect(res.data.arriveTime).toBe("41");
            expect(res.data.mileage).toBe(42);
            expect(res.data.goodsTypeId).toBe("43");
            expect(res.data.goodsType).toBe("44");
            expect(res.data.goodsId).toBe("45");
            expect(res.data.goodsName).toBe("46");
            expect(res.data.goodsNum).toBe(47);
            expect(res.data.goodsNumUnit).toBe("48");
            expect(res.data.goodsNumTwo).toBe("49");
            expect(res.data.goodsNumUnitTwo).toBe("50");
            expect(res.data.tonRange).toBe("51");
            expect(res.data.dispatcherName).toBe("52");
            expect(res.data.dispatcherPhone).toBe("53");
            expect(res.data.businessAffairsName).toBe("54");
            expect(res.data.customerServiceName).toBe("55");
            expect(res.data.plannerName).toBe("56");
            expect(res.data.extData).toBe("11");
            done();
        },(err) => {
             done.fail(err);
        })
    })

    /**
     * 获取子单详情
     */
    it("get orderChildDetail",(done) => {
        service.getOrderChildDetail("11").then((res) => {
             expect(res.data.id).toBe("1");
             expect(res.data.orderId).toBe("2");
             expect(res.data.shipProvince).toBe("3");
             expect(res.data.shipCity).toBe("4");
             expect(res.data.shipArea).toBe("5");
             expect(res.data.shipAddress).toBe("6");
             expect(res.data.viaAddressList.length).toBe(2);
             expect(res.data.deliverProvince).toBe("8");
             expect(res.data.deliverCity).toBe("9");
             expect(res.data.deliverArea).toBe("10");
             expect(res.data.deliverAddress).toBe("11");
             expect(res.data.shipTime).toBe("12");
             expect(res.data.arriveTime).toBe("13");
             expect(res.data.mileage).toBe(14);
             expect(res.data.goodsTypeId).toBe("15");
             expect(res.data.goodsType).toBe("16");
             expect(res.data.goodsId).toBe("17");
             expect(res.data.goodsName).toBe("18");
             expect(res.data.goodsNum).toBe(19);
             expect(res.data.goodsNumUnit).toBe("20");
             expect(res.data.goodsNumTwo).toBe("21");
             expect(res.data.goodsNumUnitTwo).toBe("22");
             expect(res.data.tonRange).toBe("23");
             expect(res.data.receivablePrice).toBe(24);
             expect(res.data.receivablePriceUnit).toBe("25");
             expect(res.data.receivableTotal).toBe(26);
             expect(res.data.settleType).toBe("27");
             expect(res.data.includeTax).toBe("28");
             expect(res.data.receivableRemarks).toBe("29");
             expect(res.data.settleId).toBe("30");
             expect(res.data.reckoner).toBe("31");
             expect(res.data.projectId).toBe("32");
             expect(res.data.projectCode).toBe("33");
             expect(res.data.projectName).toBe("34");
             expect(res.data.shipOrderId).toBe("35");
             expect(res.data.takeGoodsCompanyId).toBe("36");
             expect(res.data.takeGoodsCompany).toBe("37");
             expect(res.data.consignee).toBe("38");
             expect(res.data.classonsigneePhone).toBe("39");
             expect(res.data.projectTotal).toBe("40");
             expect(res.data.projectTotalUnit).toBe("41");
             expect(res.data.extData).toBe("11");
             done();
        },(err) => {
            done.fail(err);
        })
    })

    /**
     * 获取承运单详情
     */
    it("get carryOrderDetail",(done) => {
        service.getCarryOrder("11").then((res) => {
            expect(res.data.contract.carrierOrderId).toBe('1');
            expect(res.data.contract.contractId).toBe('2');
            expect(res.data.contract.contractNumber).toBe('3');
            expect(res.data.contract.contractGoodsNum).toBe(4);
            expect(res.data.contract.contractGoodsNumUnit).toBe('5');
            expect(res.data.contract.contractTime).toBe('6');
            expect(res.data.contract.consignee).toBe('7');
            expect(res.data.contract.consigneePhone).toBe('8');
            expect(res.data.contract.oilCardStatus).toBe('9');
            expect(res.data.contract.oilCarNum).toBe('10');
            expect(res.data.contract.auxiliaryTool).toBe('11');
            expect(res.data.contract.engineNumber).toBe('12');
            expect(res.data.contract.frameNumber).toBe('13');
            expect(res.data.contract.trailerNumber).toBe('14');
            expect(res.data.contract.trailerFrameNumber).toBe('15');
            expect(res.data.contract.driverLicenseNumber).toBe('16');
            expect(res.data.contract.altermatePhone).toBe('17');
            expect(res.data.contract.attachmentList.length).toBe(2);
            expect(res.data.contract.remarks).toBe('19');

            expect(res.data.contractStatus).toBe('2');
            expect(res.data.tempCustomerService).toBe('3');
            expect(res.data.tempCustomerServiceId).toBe(4);
            expect(res.data.orderCodeList.length).toBe(3);
            expect(res.data.orderRemarks).toBe('6');
            expect(res.data.orderList.length).toBe(3);
            expect(res.data.carrierId).toBe('8');
            expect(res.data.carrierName).toBe('9');
            expect(res.data.carrierPhone).toBe('10');
            expect(res.data.carrierType).toBe('11');
            expect(res.data.carId).toBe('12');
            expect(res.data.carCode).toBe('13');
            expect(res.data.driverPhone).toBe('14');
            expect(res.data.driverName).toBe('15');
            expect(res.data.carLength).toBe('16');
            expect(res.data.carType).toBe('17');
            expect(res.data.carrierReceivablePirce).toBe(18);
            expect(res.data.carrierReceivablePirceUnit).toBe('19');
            expect(res.data.carrierReceivableRemarks).toBe('20');
            
            expect(res.data.advancePaymentList.length).toBe(1);
            expect(res.data.advancePaymentList[0].advancePrice).toBe(21);
            expect(res.data.advancePaymentList[0].advancePriceType).toBe("21");

            expect(res.data.receiptPrice).toBe(22);
            expect(res.data.receiptPriceType).toBe('23');
            expect(res.data.holder).toBe('24');
            expect(res.data.bankId).toBe('25');
            expect(res.data.bankCode).toBe('26');
            expect(res.data.openBank).toBe('27');
            expect(res.data.receiptPriceHolder).toBe('28');
            expect(res.data.receiptPriceBankId).toBe('29');
            expect(res.data.receiptPriceBankCode).toBe('30');
            expect(res.data.receiptPriceOpenBank).toBe('31');
            expect(res.data.carryOrderRemarks).toBe('32');
            expect(res.data.attachment.length).toBe(3);
            expect(res.data.attachmentDetails).toBe('34');
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    })

    /**
     * 获取承运单报表列表
     */
    it("Get reportCarrierOrderList",(done) => {
        service.getReportCarrierOrderList("1",true,"3","4","5","6","7","8","9","10",0,10).then((res) => {
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8|9|10|0|10");
            expect(res.data.total).toBe(10);
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //常规无条件获取银行列表
    it('get bank list normal',(done) => {
        service.getBankList(null, null, null, null, 0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取车辆编号包含1的银行列表
    it('get bank list by carId \'1\'',(done) => {
        service.getBankList('1',null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取承运商编号包含2的银行列表
    it('get bank list by carrierId \'2\'',(done) => {
        service.getBankList(null,'2',null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|2|||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取银行卡号包含3的银行列表
    it('get bank list by bankCode \'3\'',(done) =>{
        service.getBankList(null,null,'3',null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||3||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取车场查询的银行列表
    it('get bank list by isVehicle \'true\' ',(done) => {
        service.getBankList(null,null,null,true,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||true|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车辆编号包含1,承运商编号包含2 银行卡号包含3,车场查询 的银行列表
    it('get bank list by  carId \'1\' and carrierId \'2\' and bankCode \'3\' and isVehicle \'true\' ',(done) =>{
        service.getBankList('1','2','3',true,0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1|2|3|true|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });

    //获取账户详情
    it('get bankDetail',(done)=>{
        service.getBankDetail('1').then((res)=>{
            expect(res.data.id).toBe("detail");
            expect(res.data.index).toBe(2);
            expect(res.data.bank).toBe("工商银行");
            expect(res.data.cardNumber).toBe("62220100");
            expect(res.data.holder).toBe("洋洋");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //获取银行卡信息
    it('get bankName',(done)=>{
        service.BankInfo('6230661031001814521').then((res)=>{
            expect(res.data).toBe("6230661031001814521");
            done();
        },(err)=>{
            done.fail(err);
        });
    });


    //常规无条件获取车辆列表
    it('get car list normal',(done) => {
        service.getCarList(null, null, null, null,null,null,null,null,null,null,null, 0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取排序字段枚举包含 1 的车辆列表
    it('get car list by orderBy \'1\'',(done) => {
        service.getCarList('1',null,null,null,null,null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1|||||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取升序的车辆列表
    it('get car list by asc \'true\'',(done) => {
        service.getCarList(null,true,null,null,null,null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取车牌号包含A的车辆列表
    it('get car list by carCode \'A\'',(done) => {
        service.getCarList(null,null,'A',null,null,null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||A|||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取车型包含 厢车 的车辆列表
    it('get car list by carType \'厢车\'',(done) =>{
        service.getCarList(null,null,null,'厢车',null,null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||厢车||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取车长包含 4.2米 的车辆列表
    it('get car list by carLength \'4.2米\'',(done) =>{
        service.getCarList(null,null,null,null,'4.2米',null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||4.2米|||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取录入人包含 测试 的车辆列表
    it('get car list by inputPerson \'测试\'',(done) =>{
        service.getCarList(null,null,null,null,null,'测试',null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||测试||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取驾驶员包含 胡 的车辆列表
    it('get car list by driver \'胡\'',(done) =>{
        service.getCarList(null,null,null,null,null,null,'胡',null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||||胡|||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取驾驶员号码包含 7 的车辆列表
    it('get car list by driverPhone \'7\'',(done) =>{
        service.getCarList(null,null,null,null,null,null,null,'7',null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||||7||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    }); 
    //获取承运类别包含 整车 的车辆列表
    it('get car list by carrierCategory \' 整车\'',(done) =>{
        service.getCarList(null,null,null,null,null,null,null,null,'整车',null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||||||整车|||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });  
    //获取主营路线包含 镇江 的车辆列表
    it('get car list by mainRoute \'镇江\'',(done) =>{
        service.getCarList(null,null,null,null,null,null,null,null,null,'镇江',null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||||||镇江||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    }); 
    //获取是否启用包含 禁用 的车辆列表
    it('get car list by isEnabled  \'false\'',(done) =>{
        service.getCarList(null,null,null,null,null,null,null,null,null,null,false,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||||||||false|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    }); 
    //获取排序字段枚举包含 1,升序,车牌号包含苏L00001,车型包含厢车，车长包含4.5米 ，录入人包含测试，驾驶员包含胡，驾驶员号码包含7，承运类别包含 整车，主营路线包含 镇江，禁用 的车辆列表
    it('get car list by orderBy \'1\' and asc \'true\' and carCode \'苏L00001\' and carType \'厢车\' and carLength \'4.5米\' and inputPerson \'测试\' and driver \'胡\' and driverPhone \'7\' and carrierCategory \'整车\' and mainRoute \'镇江\' and isEnabled \'false\'',(done) => {
        service.getCarList('1',true,'苏L00001','厢车','4.5米','测试','胡','7','整车','镇江',false,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1|true|苏L00001|厢车|4.5米|测试|胡|7|整车|镇江|false|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });

    //获取车牌号包含苏L00001 的交易记录
    it('get tradingRecord list by carcode \'苏L00001\'',(done)=>{
        service.getTradingRecordList('苏L00001',null,null,null,null,null,0,10).then((res)=>{  
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L00001||||||0|10');        
            done();
        },(err)=>{
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L00001 ,货物名称包含货物 的交易记录
    it('get tradingRecord list by carcode \'苏L00001\' and goodsname \'货物\'',(done) => {
        service.getTradingRecordList('苏L00001','货物',null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L00001|货物|||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L00001 ，货物数量包含1立方 的交易记录
    it('get tradingRecord list by carcode \'苏L00001\' and goodsnum \'1立方\'',(done) => {
        service.getTradingRecordList('苏L00001',null,'1立方',null,null,null,0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L00001||1立方||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L19980 ,线路地址包含江苏 的交易记录
    it('get tradingRecord list by carcode \'苏L19980\' and route \'江苏\'',(done) => {
        service.getTradingRecordList('苏L19980',null,null,'江苏',null,null,0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980|||江苏|||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L19980 ,发货地址包含 江苏 的交易记录
    it('get tradingRecord list by carcode \'苏L19980\' and shipaddress \'江苏\' ',(done) => {
        service.getTradingRecordList('苏L19980',null,null,null,'江苏',null,0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980||||江苏||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L19980 ,送货地址包含 镇江 的交易记录
    it('get tradingRecord list by carcode \'苏L19980\' and deliveraddress \'镇江\' ',(done) => {
        service.getTradingRecordList('苏L19980',null,null,null,null,'镇江',0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980|||||镇江|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L19980 ,货物名称包含货物，货物数量包含1立方,线路地址包含北京,发货地址包含 江苏, 送货地址包含 镇江 的交易记录
    it('get tradingRecord list by carcode \'苏L19980\' and  goodsname \'货物\' and  goodsnum \'1立方\' and route \'北京\' and shipaddress \'江苏\' and deliveraddress \'镇江\'',(done) => {
        service.getTradingRecordList('苏L19980','货物','1立方','北京','江苏','镇江',0,10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980|货物|1立方|北京|江苏|镇江|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });

    //常规无条件获取诚信记录
    it('get evaluate list normal',(done)=>{
        service.getEvaluateList(null,null,0,10).then((res)=>{  
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||0|10');           
            done();
        },(err)=>{
            done.fail(err);
        });
    });
    //获取车牌号包含苏L19980 的诚信记录  
    it('get evaluate list by carCode \'苏L19980\' ',(done)=>{
        service.getEvaluateList('苏L19980',null,0,10).then((res)=>{
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980||0|10');  
            done(); 
        },(err)=>{
            done.fail(err);
        });
    });
    //获取 车牌号包含苏L19980 ,评价人编号包含 2 的诚信记录  
    it('get evaluate list  by carCode \'苏L19980\' and appraiserId \'2\' ',(done)=>{
        service.getEvaluateList('苏L19980','2',0,10).then((res)=>{
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('苏L19980|2|0|10');  
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //获取车辆详情
    it('get carDetail',(done)=>{
        service.getCarDetail('2').then((res)=>{
            expect(res.data.carCode).toBe("苏L00001");
            expect(res.data.carType).toBe("厢车");
            expect(res.data.carLength).toBe("4.5米");
            expect(res.data.driver).toBe("胡");
            expect(res.data.driverPhone).toBe("7");
            expect(res.data.carriageType).toBe("整车");
            expect(res.data.bearing).toBe("2");
            expect(res.data.carSource).toBe("买");
            expect(res.data.address).toBe("镇江");
            expect(res.data.attachmentList[0].attachmentId).toBe("1");
            expect(res.data.attachmentList[0].attachmentName).toBe("名称");
            expect(res.data.attachmentList[0].attachmentPath).toBe("路径");
            expect(res.data.attachmentList[0].attachmentTag).toBe("tag");
            expect(res.data.locationStatus).toBe(true);
            expect(res.data.average).toBe(100);
            expect(res.data.praiseCount).toBe(30);
            expect(res.data.isEnabled).toBe(false);
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //获取升序的承运商列表
    it('get carrier list by asc \'true\' ',(done) => {
        service.getCarrierList(null,true,null,null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取承运商名称包含 小程 的承运商列表
    it('get carrier list by name \'小程\'',(done) => {
        service.getCarrierList(null,null,'小程',null,null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||小程|||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });

    //获取承运商号码包含 7 的承运商列表
    it('get carrier list by phone \'7\' ',(done) =>{
        service.getCarrierList(null,null,null,'7',null,null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||7||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取承运商类型包含 司机 的承运商列表
    it('get carrier list by type \'司机\' ',(done) =>{
        service.getCarrierList(null,null,null,null,'司机',null,null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||司机|||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取录入人包含 测试 的承运商列表
    it('get carrier list by inputperson \'测试\' ',(done) =>{
        service.getCarrierList(null,null,null,null,null,'测试',null,null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||测试||||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取承运商等级包含 VIP 的承运商列表
    it('get carrier list by level \'VIP\' ',(done) =>{
        service.getCarrierList(null,null,null,null,null,null,'VIP',null,null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||||VIP|||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取主营路线包含 镇江 的承运商列表
    it('get carrier list by mainroute \'镇江\'',(done) =>{
        service.getCarrierList(null,null,null,null,null,null,null,'镇江',null,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|||||||镇江||0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    }); 
    //获取是否启用包含 禁用 的承运商列表
    it('get carrier list by isenabled \'false\'',(done) =>{
        service.getCarrierList(null,null,null,null,null,null,null,null,false,0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('||||||||false|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    }); 
    //获取排序字段枚举包含 1，升序，承运商名称包含小程，承运商号码包含 7 ，承运商类型包含 司机，录入人包含 测试，承运商等级包含 VIP，主营路线包含 镇江，禁用的承运商列表
    it('get carrier list by orderBy \'1\' and asc \'true\' and name \'小程\' and phone \'7\' and type \'司机\' and inputPerson \'测试\' and level \'VIP\' and mainRoute \'镇江\' and isEnabled \'false\' ',(done)=>{
        service.getCarrierList('1',true,'小程','7','司机','测试','VIP','镇江',false,0,10).then((res)=>{
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('1|true|小程|7|司机|测试|VIP|镇江|false|0|10');
            done();
        },(err)=>{
            done.fail(err);
        })
    })

    //常规无条件获取承运商所属车辆列表
    it('get belongCarrierCar list normal',(done) => {
        service.getBelongCarrierCarList(null,0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|0|10');
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取 承运商编号包含3 的承运商所属车辆列表
    it('get belongCarrierCar list by id \'3\' ',(done)=>{
        service.getBelongCarrierCarList('3',0,10).then((res)=>{
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('3|0|10');
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //获取承运商详情
    it('get carrierDetail',(done)=>{
        service.getCarrierDetail('3').then((res)=>{
            expect(res.data.name).toBe("detail");
            expect(res.data.type).toBe("司机");
            expect(res.data.phone).toBe("15854565852");
            expect(res.data.level).toBe("VIP");
            expect(res.data.address).toBe("镇江");
            expect(res.data.isEnabled).toBe(true);
            expect(res.data.remarks).toBe("备注");
            expect(res.data.AttachmentList[0].attachmentId).toBe('1');
            expect(res.data.AttachmentList[0].attachmentName).toBe('name2');
            expect(res.data.AttachmentList[0].attachmentPath).toBe('path2');
            expect(res.data.AttachmentList[0].attachmentTag).toBe('tag2');
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //常规无条件获取线路列表
    it('get routeLine list normal', (done) => {
        service.getRouteLineList(null, null, 0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe("||0|10");
            done();
        }, (err) => {
            done.fail(err);
        });
    });
    //获取车辆编号包含 1 的线路列表
    it('get routeLine list by carid \'1 \' ', (done) => {
        service.getRouteLineList('1', null, 0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe("1||0|10");
            done();
        }, (err) => {
            done.fail(err);
        });
    });
    //获取承运商编号包含 2 的线路列表
    it('get routeLine list by carrierid \'2 \' ', (done) => {
        service.getRouteLineList(null, '2', 0, 10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe("|2|0|10");
            done();
        }, (err) => {
            done.fail(err);
        });
    });
    //获取车辆编号包含 1 和 承运商编号包含 2 的线路列表
    it('get routeLine list by carid \'1 \' and carrierid \'2 \' ', (done) => {
        service.getRouteLineList('1', '2', 0, 10).then((res) => {
            expect(res.data.total).toBe(10);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe("1|2|0|10");
            done();
        }, (err) => {
            done.fail(err);
        });
    });

    //修改承运单承运商信息
    it('update Carrier',(done)=>{
        service.updateCarrier('1','2','3','4','5').then((res)=>{
            expect(res.data.extData).toBe("1|2|3|4|5");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //修改驾驶员和车辆相关信息
    it('update Car',(done)=>{
        service.updateCar('1','2','3','4','5','6').then((res)=>{
            expect(res.data.extData).toBe("1|2|3|4|5|6");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //修改应付相关信息
    it('update Payable',(done)=>{
        service.updatePayable('1',2,'3',4,'5','6','7','8','9','10','11','12',[{advancePrice:1,advancePriceType:'33'}]).then((res)=>{
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|12|1|33");
            done();
        },(err)=>{
            done.fail(err);
        });
    });

    //修改合同
    it('update Contract',(done) => {
        service.updateContract("1","2","3",4,"5","6","7","8","9","10","11","12","13").then((res) => {
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|12|13");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //修改附件
    it('update Attachment',(done)=>{
        service.updateAttachment("1",["2","3"]).then((res)=>{
            expect(res.data.extData).toBe("1|2,3");
            done();
        },(err)=>{
            done.fail(err);
        })
    });

 });
